/**
 * @file      iprocess.h
 * @copyright Copyright (c) 2020, ZCW Co., Ltd. All Rights Reserved.
 * @brief     brief
 * @author    caiwang213@qq.com
 * @date      2020-10-15 13:48:52
 *
 * @note
 *  iprocess.h defines
 */
#ifndef __IPROCESS_H__
#define __IPROCESS_H__
#include "os.h"
#include <string>
#include <vector>
#include <map>
using namespace std;

namespace log4x
{
class iprocess
{
public:
    virtual int        pid() = 0;
    virtual int        pids(const string& pname, vector<int>& pids, vector<string>& cmdLines) = 0;
    virtual int        pids(const string& workdir, map<int, string>& procs) = 0;
    virtual string     ppath(int pid = -1) = 0;

    virtual int        system(const string& path_cmd) = 0;
    virtual int        system(const string& path_cmd, string& result) = 0;
    virtual string     cmdline(int pid = -1) = 0;

protected:
    virtual ~iprocess() {}
};
}
#endif
